package date;

class Date2{
    public int year;
    public int month;
    public int day;

    public Date2(int year,int month,int day ){
        this.year=year;
        this.month=month;
        this.day=day;
        System.out.println("调用了带有三个参数的构造方法");
    }
    public Date2(){
//this必须是构造方法的首句代码
        this(2008,9,20);//调用了三个参数的构造方法
//不调用this
//        this.year=2008;
//        this.month=9;
//        this.day=20;
    }
    public void printDate(){
        System.out.println("今天是 "+year+"年 "+month+" 月"+day+" 日");
    }
}
public class 日期3 {
    public static void main(String[] args) {
        Date2 date1=new Date2();
        date1.printDate();
        Date2 date2=new Date2();
        date2.printDate();
    }
}